package com.learning.spring.ioc.life;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * ClassName: LifeCycleBeanPostProcessor
 * Description: Bean 后置处理接口
 * Date: 2018/8/3 13:24 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
public class LifeCycleBeanPostProcessor implements BeanPostProcessor {

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("调用 BeanPostProcessor.postProcessBeforeInitialization() 方法");
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("调用 BeanPostProcessor.postProcessAfterInitialization() 方法");
        return bean;
    }
}
